package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailMapper {

    /**
     * 批量插入订单详情
     * @param orderDetailList
     */
    void insetBatch(List<OrderDetail> orderDetailList);

    /**
     * 根据订单id查询订单详情
     * @param id
     * @return
     */
    @Select("SELECT * FROM order_detail WHERE order_id = #{id}")
    List<OrderDetail> getByOrderId(Long id);

    /***
     * 条件查询
     * @param orderDetail
     * @return
     */
    List<OrderDetail> list(OrderDetail orderDetail);
}
